home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 7.3 KB | 215 lines | [TEXT/ToyS] |
- (*
- Version 1.07
-
- History
- Ver Who When What
- 107 GOD 13.03.98 Use Akua Sweets V1.2 to speed things up (set Finder info for)
- 106 GOD 25.01.98 Move "Text Encodings" to the left side, add flag to move "At Ease" to left side
- 105 GOD 12.08.97 Add "Scripting Additions" and "Bride" for MacOS 8/8.01
- 104 GOD 08.05.97 Support new names of German disabled folders under MacOS 7.6 / Extensions Manager 4
- Support "Text Encodings"
- 103 GOD 01.02.97 Support German System Folders, support invisibles with a beep
- Support dropped-on System Folders
- 102 GOD 25.01.97 Support "At Ease" items
- 101 GOD 18.01.97 Add "Desktop Printers" and "Launcher Items" to system folders list
- *)
-
- -- Boolean options
- property kapUseFinder : true
- property kapAtEaseAtLeft : true
-
- -- View for the System Folder (Small Snap-To-Grid Icons)
- property kapSystemFolderView : 334
-
- -- A "+" as an item name creates a space in the positioning
-
- -- Items considered system folders in the order of display
- property kapSysFolders : {"+", "Apple-Menü", "Apple Menu Items", "Application Support", "Ausschaltobjekte", "ColorSync Profiles", "Contextual Menu Items", "Control Panels", "Control Strip Modules", "Desktop Printers", "Editors", "Extensions", "Fonts", "KlickStarter-Objekte", "Kontrolleistenmodule", "Kontrollfelder", "Launcher Items", "PowerTalk Data", "Preferences", "PrintMonitor-Dokumente", "PrintMonitor Documents", "Scripting Additions", "Shutdown Items", "Startobjekte", "Startup Items", "Systemerweiterungen", "Text Encodings", "Zeichensätze"}
-
- -- Items considered system folders for disabled items and AtEase items in reverse alphabetical order - since this is reversed
- property kapSysFoldDis : {"Systemordner (Aus)", "Systemerweiterungen (Aus)", "System Folder (Disabled)", "System Extensions (Disabled)", "Startup Items (Disabled)", "Startobjekte (Aus)", "Shutdown Items (Disabled)", "Kontrolleistenmodule (Aus)", "Kontrollfelder (Aus)", "Fonts (Disabled)", "Extensions (Disabled)", "Control Strip Modules (Dis.)", "Control Panels (Disabled)", "Apple Menu Items (Disabled)", "Ausschaltobjekte (Aus)"}
-
- -- Items considered to be system extras (e.g. AtEase)
- property kapAtEaseItems : {"At Ease", "At Ease Help", "At Ease Hilfe", "At Ease Items", "At Ease Objekte", "Geschützte Objekte"}
-
- -- Items considered system files
- property kapSysItems : {"System", "Finder", "MacsBug", "StartupScreen", "StartupScreen 0", "StartupScreen 1", "+", "Albumdatei", "Clipboard", "Hosts", "MacTCP DNR", "Note Pad File", "Scrapbook File"}
-
- -- Spacing for columns and rows
- property kapPosX : 0
- property kapPosY : 0
- property kapSpaceY : 18
- property kapSpaceX : 132
-
-
- on run
- open {path to system folder}
- end run
-
-
- on open fsObjs
- repeat with fsObj in fsObjs
- set sysPath to fsObj
- set sysPathStr to (sysPath as string)
-
- if (kapUseFinder) then ¬
- tell application "Finder" to reveal ((sysPathStr & "System") as alias)
-
- -- Set Small Snap-To-Grid View
- SetView(sysPath, kapSystemFolderView)
-
- -- Do the items we know of (column 1 of folder)
- set kapPosX to 0 -- go to top of first column
- set kapPosY to kapSpaceY
- set pendingSpace to false
- set sysItems to kapSysItems
-
- -- Add AtEase to system stuff (with a spacing)?
- if (kapAtEaseAtLeft) then set sysItems to sysItems & {"+"} & kapAtEaseItems
-
- repeat with sysItem in sysItems
- -- Do the System Items
- if (character 1 of sysItem is "+") then
- set pendingSpace to true
- else if (the kind of entry in sysPath named sysItem) is not nothing then
- if pendingSpace then set kapPosY to kapPosY + kapSpaceY
- set pendingSpace to false
- SetPosition((sysPathStr & sysItem) as alias, kapPosX, kapPosY, 1)
- set kapPosY to kapPosY + kapSpaceY
- end if
- end repeat
-
- set pendingSpace to false
-
- repeat with sysItem in kapSysFolders
- -- Do the System Folders
- if (character 1 of sysItem is "+") then
- set pendingSpace to true
- else if (the kind of entry in sysPath named sysItem) is not nothing then
- if pendingSpace then set kapPosY to kapPosY + kapSpaceY
- set pendingSpace to false
- SetPosition((sysPathStr & sysItem) as alias, kapPosX, kapPosY, 2)
- set kapPosY to kapPosY + kapSpaceY
- end if
- end repeat
-
- -- go to bottom of second column
- set kapPosX to kapPosX + kapSpaceX
- set kapPosY to kapPosY - kapSpaceY
- SetWindowSize(sysPath, kapPosX + kapSpaceX + kapSpaceX, kapPosY + kapSpaceY + kapSpaceY)
- set pendingSpace to false
- set sysItems to kapSysFoldDis
-
- -- Add AtEase at top of disabled stuff (with a spacing)?
- if (not kapAtEaseAtLeft) then ¬
- set sysItems to sysItems & {"+"} & asReverseList(kapAtEaseItems)
-
- repeat with sysItem in sysItems
- -- Do the System Disabled Folders
- if (character 1 of sysItem is "+") then
- set pendingSpace to true
- else if (the kind of entry in sysPath named sysItem) is not nothing then
- if pendingSpace then set kapPosY to kapPosY + kapSpaceY
- set pendingSpace to false
- set labelIdx to 2
- if (sysItem contains "(") then set labelIdx to 6
- SetPosition((sysPathStr & sysItem) as alias, kapPosX, kapPosY, labelIdx)
- set kapPosY to kapPosY - kapSpaceY
- end if
- end repeat
-
- -- DO the items we don't know of
- set kapPosX to kapSpaceX
- set kapPosY to kapSpaceY
-
- set sysItems to the entries in sysPath
- set orderedItems to (kapSysFoldDis & kapSysFolders & kapSysItems & kapAtEaseItems)
-
- repeat with fsName in sysItems
- -- Not already positioned?
- if (fsName is not in orderedItems) then
- SetPosition((sysPathStr & fsName) as alias, kapPosX, kapPosY, 3)
- set kapPosY to kapPosY + kapSpaceY
- end if
- end repeat
- end repeat
- end open
-
-
-
- on ReverseList(aList)
- set revList to {}
- set iCnt to count (items of aList)
-
- repeat with i from iCnt to 1 by -1
- set revList to revList & {item i of aList}
- end repeat
-
- return revList
- end ReverseList
-
-
-
- on SetPosition(fsObj, x, y, labelNum)
- -- Set the position of a file's icon in a folder to x,y
- if (kapUseFinder) then
- -- try
- tell application "Finder"
- reveal fsObj
- set the position of fsObj to {x, y}
- set the label index of fsObj to labelNum
- end tell
- -- on error
- -- end try
- else
- set fInfo to the extended info for fsObj
- set finder location of fInfo to {x, y}
- set label number of fInfo to labelNum
- set the catalog info of fsObj to fInfo
- end if
- end SetPosition
-
-
-
- on SetView(fsObj, viewConstant)
- -- Set the view of a folder
- if (kapUseFinder) then
- -- try
- tell application "Finder"
- open {fsObj}
- -- set the view of fsObj to viewConstant
- end tell
- -- on error
- -- end try
- else
- set fInfo to the extended info for fsObj
- set finder view setting of fInfo to viewConstant
- set the catalog info of fsObj to fInfo
- end if
- end SetView
-
-
-
- on SetWindowSize(fsObj, dX, dY)
- -- Set the size of a folder's window to dx,dy
- if (kapUseFinder) then
- -- try
- tell application "Finder"
- open fsObj
- set newBox to (bounds of container window of fsObj)
- set item 3 of newBox to (item 1 of newBox) + dX
- set item 4 of newBox to (item 2 of newBox) + dY
- set bounds of container window of fsObj to newBox
- end tell
- -- on error
- -- end try
- else
- set fInfo to the extended info for fsObj
- set newBox to finder window box of fInfo
- set item 3 of newBox to (item 1 of newBox) + dX
- set item 4 of newBox to (item 2 of newBox) + dY
- set finder window box of fInfo to newBox
- set the catalog info of fsObj to fInfo
- end if
- end SetWindowSize
-